<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use app\models\TraceSystemContent;

?>

<div style="position:relative;left:0px;top:150px;height:300px;width:600px;">

    <div  style="position:relative;height:300px;width:565px;left:-8px;top:-150px;">


        <table id="customers">

            <tr >


                <th>农药ID</th>
                <th>所属批次ID</th>
                <th>溯源生长期</th>
                <th>农药名称</th>
                <th>农药用量</th>
                <th>用量单位</th>
                <th>品牌</th>
                <th>供应商</th>
                <th>备注</th>

            </tr>

            <?php foreach($models as $model)
            {
                ?>

            <?php

            $sql="select index_name from shbb_trace_system_content where id=$model->state_id";
            $sys_model=tracesystemcontent::findBySql($sql)->all();  //根据使用期的编号查找 属于该生长期的农药
            ?>

            <?php foreach($sys_model as $smodel) {
                ?>

                <tr  class="alt">


                    <td style="border:0px;background:white;"><?=$model->id;?></td>
                    <td style="border:0px;background:white;"><?=$model->batch_id;?></td>
                    <td style="border:0px;background:white;"><?= $smodel->index_name; ?></td>
                    <td style="border:0px;background:white;"><?=$model->name;?></td>
                    <td style="border:0px;background:white;"><?=$model->dosage;?></td>
                    <td style="border:0px;background:white;"><?=$model->unit;?></td>
                    <td style="border:0px;background:white;"><?=$model->band;?></td>
                    <td style="border:0px;background:white;"><?=$model->supplier;?></td>
                    <td style="border:0px;background:white;"><?=$model->comment;?></td>


                </tr>

                <?php
            }
                ?>


                <?php
            }
            ?>
        </table>

    </div>

</div>




